package com.atguigu.lease.web.app.custom.interceptors;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author 芦博
 * @description
 * @createDate 2025/11/10 20:35
 */
public class SpringMvcConfigration implements WebMvcConfigurer {
    @Value("${web.app.interceptor-include-path}")
    private String[] include;
    @Value("${web.app.interceptor-exclude-path}")
    private String[] exclude;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
       registry.addInterceptor(new LoginInterceptors())
               .addPathPatterns(include)
               .excludePathPatterns(exclude).order(1);
    }
}
